home *** CD-ROM | disk | FTP | other *** search
/ Macworld Expo - Develope…Central & Net Innovations / Developer Central and Net Innovators (MacWorld Expo) (January 1999).iso / Developer Central / Bowers Development / Demo AppMaker / Examples / PowerPlant / Everything / DModelessTextData.cp < prev    next >
Encoding:
Text File  |  1998-10-11  |  3.8 KB  |  239 lines  |  [TEXT/CWIE]

  1. // DModelessTextData.cp -- data container class for Everything
  2.  
  3. #include "DModelessTextData.h"
  4.  
  5. #include <LFileStream.h>
  6.  
  7.  
  8. //----------
  9. DModelessTextData::DModelessTextData ()
  10. {
  11.     LString::CopyPStr ("\pSmall", mSmall3);
  12.     LString::CopyPStr ("\pLarge", mLarge3);
  13.     mX12347 = 12345;
  14.     mX12345e8 = 123.45e6;
  15.     LString::CopyPStr ("\pPassword", mPassword3);
  16.     GetLongDateTime (&mDate3);
  17.     GetLongDateTime (&mTime3);
  18.     LString::CopyPStr ("\pStyled", mStyled3);
  19. }
  20.  
  21. //----------
  22. DModelessTextData::~DModelessTextData ()
  23. {
  24. }
  25.  
  26. //----------
  27. void    DModelessTextData::CopyFrom (
  28.     DModelessTextData*        inOther)
  29. {
  30.     LString::CopyPStr (inOther->mSmall3, mSmall3);
  31.     LString::CopyPStr (inOther->mLarge3, mLarge3);
  32.     mX12347 = inOther->mX12347;
  33.     mX12345e8 = inOther->mX12345e8;
  34.     LString::CopyPStr (inOther->mPassword3, mPassword3);
  35.     mDate3 = inOther->mDate3;
  36.     mTime3 = inOther->mTime3;
  37.     LString::CopyPStr (inOther->mStyled3, mStyled3);
  38. }
  39.  
  40. //----------
  41. void    DModelessTextData::ReadFromFile (
  42.     LFileStream*    inFile)
  43. {
  44. }
  45.  
  46. //----------
  47. void    DModelessTextData::WriteToFile (
  48.     LFileStream*    inFile)
  49. {
  50. }
  51.  
  52.  
  53. //----------
  54. StringPtr    DModelessTextData::GetSmall3 (
  55.     Str255        outPtr) const
  56. {
  57.  
  58.     if (outPtr != nil) {
  59.         LString::CopyPStr (mSmall3, outPtr);
  60.     }
  61.     return (StringPtr)mSmall3;
  62. }
  63.  
  64. //----------
  65. void    DModelessTextData::SetSmall3 (
  66.     ConstStringPtr    inValue)
  67. {
  68.     LString::CopyPStr (inValue, mSmall3);
  69.     
  70.     SignalDataChanged (idSmall3);
  71. }
  72.  
  73. //----------
  74. void    DModelessTextData::SetSmall3 (
  75.     CharsHandle        inValue)
  76. {
  77.     SetPStr (mSmall3, sizeof (mSmall3), inValue);
  78.     
  79.     SignalDataChanged (idSmall3);
  80. }
  81.  
  82.  
  83. //----------
  84. StringPtr    DModelessTextData::GetLarge3 (
  85.     Str255        outPtr) const
  86. {
  87.  
  88.     if (outPtr != nil) {
  89.         LString::CopyPStr (mLarge3, outPtr);
  90.     }
  91.     return (StringPtr)mLarge3;
  92. }
  93.  
  94. //----------
  95. void    DModelessTextData::SetLarge3 (
  96.     ConstStringPtr    inValue)
  97. {
  98.     LString::CopyPStr (inValue, mLarge3);
  99.     
  100.     SignalDataChanged (idLarge3);
  101. }
  102.  
  103. //----------
  104. void    DModelessTextData::SetLarge3 (
  105.     CharsHandle        inValue)
  106. {
  107.     SetPStr (mLarge3, sizeof (mLarge3), inValue);
  108.     
  109.     SignalDataChanged (idLarge3);
  110. }
  111.  
  112.  
  113. //----------
  114. SInt32        DModelessTextData::GetX12347 () const
  115. {
  116.  
  117.     return mX12347;
  118. }
  119.  
  120. //----------
  121. void    DModelessTextData::SetX12347 (
  122.     SInt32        inValue)
  123. {
  124.     mX12347 = inValue;
  125.     
  126.     SignalDataChanged (idX12347);
  127. }
  128.  
  129.  
  130. //----------
  131. double        DModelessTextData::GetX12345e8 () const
  132. {
  133.  
  134.     return mX12345e8;
  135. }
  136.  
  137. //----------
  138. void    DModelessTextData::SetX12345e8 (
  139.     double        inValue)
  140. {
  141.     mX12345e8 = inValue;
  142.     
  143.     SignalDataChanged (idX12345e8);
  144. }
  145.  
  146.  
  147. //----------
  148. StringPtr    DModelessTextData::GetPassword3 (
  149.     Str255        outPtr) const
  150. {
  151.  
  152.     if (outPtr != nil) {
  153.         LString::CopyPStr (mPassword3, outPtr);
  154.     }
  155.     return (StringPtr)mPassword3;
  156. }
  157.  
  158. //----------
  159. void    DModelessTextData::SetPassword3 (
  160.     ConstStringPtr    inValue)
  161. {
  162.     LString::CopyPStr (inValue, mPassword3);
  163.     
  164.     SignalDataChanged (idPassword3);
  165. }
  166.  
  167. //----------
  168. void    DModelessTextData::SetPassword3 (
  169.     CharsHandle        inValue)
  170. {
  171.     SetPStr (mPassword3, sizeof (mPassword3), inValue);
  172.     
  173.     SignalDataChanged (idPassword3);
  174. }
  175.  
  176.  
  177. //----------
  178. LongDateRec        DModelessTextData::GetDate3 () const
  179. {
  180.  
  181.     return mDate3;
  182. }
  183.  
  184. //----------
  185. void    DModelessTextData::SetDate3 (
  186.     LongDateRec        inValue)
  187. {
  188.     mDate3 = inValue;
  189.     
  190.     SignalDataChanged (idDate3);
  191. }
  192.  
  193.  
  194. //----------
  195. LongDateRec        DModelessTextData::GetTime3 () const
  196. {
  197.  
  198.     return mTime3;
  199. }
  200.  
  201. //----------
  202. void    DModelessTextData::SetTime3 (
  203.     LongDateRec        inValue)
  204. {
  205.     mTime3 = inValue;
  206.     
  207.     SignalDataChanged (idTime3);
  208. }
  209.  
  210.  
  211. //----------
  212. StringPtr    DModelessTextData::GetStyled3 (
  213.     Str255        outPtr) const
  214. {
  215.  
  216.     if (outPtr != nil) {
  217.         LString::CopyPStr (mStyled3, outPtr);
  218.     }
  219.     return (StringPtr)mStyled3;
  220. }
  221.  
  222. //----------
  223. void    DModelessTextData::SetStyled3 (
  224.     ConstStringPtr    inValue)
  225. {
  226.     LString::CopyPStr (inValue, mStyled3);
  227.     
  228.     SignalDataChanged (idStyled3);
  229. }
  230.  
  231. //----------
  232. void    DModelessTextData::SetStyled3 (
  233.     CharsHandle        inValue)
  234. {
  235.     SetPStr (mStyled3, sizeof (mStyled3), inValue);
  236.     
  237.     SignalDataChanged (idStyled3);
  238. }
  239.